package com.edu.exam.enums.grading;

import com.edu.exam.enums.core.BaseEnum;

/**
 * 导出配置类型枚举
 */
public enum ExportConfigType implements BaseEnum {
    SYSTEM("SYSTEM", "系统配置"),
    MODULE("MODULE", "模块配置"),
    USER("USER", "用户配置"),
    TEMPLATE("TEMPLATE", "模板配置"),
    PERFORMANCE("PERFORMANCE", "性能配置"),
    SECURITY("SECURITY", "安全配置"),
    BUSINESS("BUSINESS", "业务配置"),
    NOTIFICATION("NOTIFICATION", "通知配置"),
    VALIDATION("VALIDATION", "验证配置"),
    LOGGING("LOGGING", "日志配置");

    private final String code;
    private final String description;

    ExportConfigType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static ExportConfigType fromCode(String code) {
        for (ExportConfigType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown export config type code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}